//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_SemaphoreManager_H
#define Green_SemaphoreManager_H

#include <map>
#include <string>

#include "Defines.h"

namespace Green {

  class Generator;
  class Semaphore;

  /*!
    \class SemaphoreManager
    \brief class to manage semaphores.
   */
  class SemaphoreManager {
  public:
    SemaphoreManager(); //constructor
    virtual ~SemaphoreManager(); // destructor

    bool GenSemaphore(Generator *pGen, const std::string& name, uint64 counter, uint32 bank, uint32 size, uint64& address, bool& reverseEndian); //!< generate a semaphore

  protected:
    std::map<std::string, Semaphore*> mSemaphores; //!< the container for semaphores
  };

}
#endif
